//商品
import http from "@/utils/http";
import {EnumAlias} from "@/utils/common";
//分页
export function productInfoPage(params?: object) {
  return http({
    url: `${EnumAlias.PROJECT}/${EnumAlias.MODULE_MALL}/productInfo/page`,
    method: "get",
    params
  });
}
//详情
export function productInfoDetail(params?: object) {
  return http({
    url: `${EnumAlias.PROJECT}/${EnumAlias.MODULE_MALL}/productInfo/detail`,
    method: "get",
    params
  });
}
//list集合
export function productInfoList(params?: object) {
  return http({
    url: `${EnumAlias.PROJECT}/${EnumAlias.MODULE_MALL}/productInfo/list`,
    method: "get",
    params
  });
}
//批量上下架
export function productInfoUpdatePublishStatus(data?: object) {
  return http({
    url: `${EnumAlias.PROJECT}/${EnumAlias.MODULE_MALL}/productInfo/updatePublishStatus`,
    method: "post",
    data
  });
}
//修改
export function productInfoUpdate(data?: object) {
  return http({
    url: `${EnumAlias.PROJECT}/${EnumAlias.MODULE_MALL}/productInfo/update`,
    method: "post",
    data
  });
}
//修改运营类型
export function productInfoUpdateRecommendType(data?: object) {
  return http({
    url: `${EnumAlias.PROJECT}/${EnumAlias.MODULE_MALL}/productInfo/updateRecommendType`,
    method: "post",
    data
  });
}
//批量修改税率
export function productInfoUpdatePrice(data?: object) {
  return http({
    url: `${EnumAlias.PROJECT}/${EnumAlias.MODULE_MALL}/productInfo/updatePrice`,
    method: "post",
    data
  });
}
//商品别名保存
export function productInfoSetNcName(data?: object) {
  return http({
    url: `${EnumAlias.PROJECT}/${EnumAlias.MODULE_MALL}/productInfo/setNcName`,
    method: "post",
    data
  });
}
//商品标签保存
export function productInfoSetTag(data?: object) {
  return http({
    url: `${EnumAlias.PROJECT}/${EnumAlias.MODULE_MALL}/productInfo/setTag`,
    method: "post",
    data
  });
}
//商品SKU设置
export function productInfoUpdateSkuValue(data?: object) {
  return http({
    url: `${EnumAlias.PROJECT}/${EnumAlias.MODULE_MALL}/productInfo/updateSkuValue`,
    method: "post",
    data
  });
}

//商品轮播图设置
export function productInfoUpdateImgUrls(data?: object) {
  return http({
    url: `${EnumAlias.PROJECT}/${EnumAlias.MODULE_MALL}/productInfo/updateImgUrls`,
    method: "post",
    data
  });
}

//商品详情图设置
export function productInfoUpdateDetailUrls(data?: object) {
  return http({
    url: `${EnumAlias.PROJECT}/${EnumAlias.MODULE_MALL}/productInfo/updateDetailUrls`,
    method: "post",
    data
  });
}

//随机配件
export function productInfoSetFittings(data?: object) {
  return http({
    url: `${EnumAlias.PROJECT}/${EnumAlias.MODULE_MALL}/productInfo/setFittings`,
    method: "post",
    data
  });
}

//产品特点
export function productInfoSetTrait(data?: object) {
  return http({
    url: `${EnumAlias.PROJECT}/${EnumAlias.MODULE_MALL}/productInfo/setTrait`,
    method: "post",
    data
  });
}

//关联商品
export function productInfoSetLinkProduct(data?: object) {
  return http({
    url: `${EnumAlias.PROJECT}/${EnumAlias.MODULE_MALL}/productInfo/setLinkProduct`,
    method: "post",
    data
  });
}

//导入别名
export function productInfoSetImportNcName(data?: object) {
  return http({
    url: `${EnumAlias.PROJECT}/${EnumAlias.MODULE_MALL}/productInfo/importNcName`,
    method: "post",
    data
  });
}
//设置一起购买的商品
export function settMatchingProducts(data?: object) {
  return http({
    url: `${EnumAlias.PROJECT}/${EnumAlias.MODULE_MALL}/productInfo/settMatchingProducts`,
    method: "post",
    data
  });
}
//获取商品运营位
export function getLimitedtimeOffer(data?: object) {
  return http({
    url: `${EnumAlias.PROJECT}/${EnumAlias.MODULE_MALL}/productLimitedtimeOffer/getLimitedtimeOffer`,
    method: "post",
    data
  });
}
//设置商品单位
export function updateMeasureUnit(data?: object) {
  return http({
    url: `${EnumAlias.PROJECT}/${EnumAlias.MODULE_MALL}/productInfo/updateMeasureUnit`,
    method: "post",
    data
  });
}
//同步商品信息
export function getIncrementProductInfo(params?: object) {
  return http({
    url: `${EnumAlias.PROJECT}/${EnumAlias.MODULE_MALL}/productSyc/getIncrementProductInfo`,
    method: "get",
    timeout: 600000,
    params
  });
}
//修改商品名称
export function productInfoUpdateName(data?: object) {
  return http({
    url: `${EnumAlias.PROJECT}/${EnumAlias.MODULE_MALL}/productInfo/updateName`,
    method: "post",
    data
  });
}
//导出上架商品
export function productInfoExportProduct(data?: object) {
  return http({
    url: `${EnumAlias.PROJECT}/${EnumAlias.MODULE_MALL}/productInfo/exportProduct`,
    method: "post",
    data,
    responseType: "blob"
  });
}
